<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%order_product}}".
 *
 * @property integer $order_id
 * @property integer $product_id
 * @property string $product_name
 * @property string $product_price
 * @property integer $quantity
 * @property string $total
 */
class OrderProduct extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%order_product}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['order_id'], 'required'],
            [['order_id', 'product_id', 'quantity'], 'integer'],
            [['product_price', 'total'], 'number'],
            [['product_name'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'order_id' => '订单ID',
            'product_id' => '商品ID',
            'product_name' => '商品名称',
            'product_price' => '商品价格',
            'quantity' => '商品数量',
            'total' => '商品金额',
        ];
    }
}
